/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package muse.frames;

import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import muse.Frame;
import muse.widgets.CyclerWidget;
import muse.widgets.MuseWidget;
import muse.widgets.TextboxWidget;

/**
 *
 * @author joe
 */
public class CharacterCustomize extends Frame{
    
    public CharacterCustomize()
    {
        this.setLayout(new BorderLayout());
        this.setOpaque(false);
        JPanel all = new JPanel();
        all.setOpaque(false);
        
        //apply gridbaglayout and initialize constraints parameter
        all.setLayout(new GridBagLayout());
        GridBagConstraints c = new GridBagConstraints(); 
        
        //create and set gridbaglayout to left panel
        JPanel left = new JPanel();
        left.setLayout(new GridBagLayout());
        
        JPanel themeCycler = new JPanel();
        //themeCycler.setBorder(BorderFactory.createLineBorder(Color.red));
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 0;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1.0;
        c.weighty = 0.125;
        c.insets = new Insets(5, 5, 5, 5);
        left.add(themeCycler, c);
        
        CyclerWidget cw = new CyclerWidget();
        themeCycler.setLayout(new BorderLayout());
        themeCycler.add(cw);
        
        JPanel partCycler = new JPanel();
        partCycler.setBorder(BorderFactory.createLineBorder(Color.red));
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 1;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1.0;
        c.weighty = 0.125;
        c.insets = new Insets(5, 5, 5, 5);
        //left.add(partCycler, c);
        
        CyclerWidget cw2 = new CyclerWidget();
        partCycler.setLayout(new BorderLayout());
        partCycler.add(cw2);
        
        JPanel avatarPanel = new JPanel();
        avatarPanel.setBorder(BorderFactory.createLineBorder(Color.blue));
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 4;
        c.gridx = 0;
        c.gridy = 2;       
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1.0;
        c.weighty = 0.5;
        c.insets = new Insets(5, 5, 5, 5);
        left.add(avatarPanel, c);
        
        JPanel helpPanel = new JPanel();
        helpPanel.setBorder(BorderFactory.createLineBorder(Color.yellow));
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 2;
        c.gridx = 0;
        c.gridy = 6;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1;
        c.weighty = 0.25;
        c.insets = new Insets(5, 5, 5, 5);
        left.add(helpPanel, c);
        
        
        
        left.setBorder(BorderFactory.createLineBorder(Color.green));
        c.fill = GridBagConstraints.BOTH;
        c.gridx = 0;
        c.gridy = 0;
        c.ipadx = (int)(320*0.70)/2;
        c.weightx = 0.75;
        c.weighty = 1.0;
        c.insets = new Insets(0, 0, 0, 0);
        all.add(left, c);
        
        JPanel right = new JPanel();
        right.setBorder(BorderFactory.createLineBorder(Color.blue));
        c.fill = GridBagConstraints.BOTH;
        c.gridx = 1;
        c.gridy = 0;
        c.ipadx = 0;
        c.weightx = 0.25;
        c.weighty = 1.0;
        c.insets = new Insets(0, 0, 0, 0);
        all.add(right, c);
        
        //add stuff to right
        right.setLayout(new GridBagLayout());
        
        JLabel goldLabel = new JLabel("Amt Gold");
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 0;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1;
        c.weighty = 0.25;
        c.insets = new Insets(5, 5, 5, 5);
        right.add(goldLabel, c);
        
        JButton headButton = new JButton("Head");
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 2;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1;
        c.weighty = 0.25;
        c.insets = new Insets(5, 5, 5, 5);
        right.add(headButton, c);
        
        JButton bodyButton = new JButton("Body");
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 3;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1;
        c.weighty = 0.25;
        c.insets = new Insets(5, 5, 5, 5);
        right.add(bodyButton, c);
        
        JButton armsButton = new JButton("Arms");
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 4;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1;
        c.weighty = 0.25;
        c.insets = new Insets(5, 5, 5, 5);
        right.add(armsButton, c);
        
        JButton legsButton = new JButton("Legs");
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 5;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1;
        c.weighty = 0.25;
        c.insets = new Insets(5, 5, 5, 5);
        right.add(legsButton, c);
        
        JButton accessoriesButton = new JButton("Accessories");
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 6;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1;
        c.weighty = 0.25;
        c.insets = new Insets(5, 5, 5, 5);
        right.add(accessoriesButton, c);
        
        JButton helpButton = new JButton("Help");
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 8;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1;
        c.weighty = 0.25;
        c.insets = new Insets(5, 5, 5, 5);
        right.add(helpButton, c);
        
        JButton randButton = new JButton("Randomize");
        c.fill = GridBagConstraints.BOTH;
        c.gridwidth = 1;
        c.gridheight = 1;
        c.gridx = 0;
        c.gridy = 9;
        c.ipadx = 0;
        c.ipady = 0;
        c.weightx = 1;
        c.weighty = 0.25;
        c.insets = new Insets(5, 5, 5, 5);
        right.add(randButton, c);
        this.add(all);
    }
}
